<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        
        <title>{% block title %}SubManager{% endblock %} - {% block subtitle %}{% endblock subtitle %}</title>
        
        <!-- Bootstrap -->
        <link href="{{ asset("bootstrap/css/bootstrap.min.css")}}" rel="stylesheet">
        
        {% block stylesheets %}

            {% stylesheets 
                'css/css/style.css' %}
                <link href="{{ asset_url }}" rel="stylesheet">
            {% endstylesheets %}
                
        {% endblock %}
        <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
        
    </head>
    <body>
        
        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
        <script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
        <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="{{ asset("bootstrap/js/bootstrap.min.js") }}"></script>
        
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    
                    {% if app.request.get('_route') == 'sm_ass_home' %}
                    <h1 class="top-title">
                    {% endif %}
                        <a class="navbar-brand" href=" {{ path('sm_ass_home') }}">SubManager</a>
                    {% if app.request.get('_route') == 'sm_ass_home' %}
                    </h1>
                    {% endif %}
                </div>
                <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="#">Accueil</a></li>
                        <li><a href="#about">Liste des fichiers</a></li>
                    </ul>
                    
                    <div class="navbar-collapse pull-right" style="padding:15px 0;">

                        {% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
                        Connecté en tant que <strong>{{ app.user.username }}</strong> - <a href="{{ path('fos_user_security_logout') }}">Déconnexion</a>
                        {% else %}
                            <a href="{{ path('fos_user_security_login') }}">Connexion</a>
                        {% endif %}
                            
                    </div>
                </div><!--/.nav-collapse -->
            </div>
        </div>
        
        <div class="content" style="padding-top:80px;">
            <div class="container">
                <div class="row">
                    {% if app.request.get('_route') != 'sm_ass_home' %}
                    <h1 class="page-title">{{ block('subtitle') }}</h1>
                    {% endif %}

                    {% block flashbag %}
                        {% for type, flashMessage in app.session.flashbag.all() %}
                            <div class="alert alert-{{ type }} fade in">
                                <button class="close" data-dismiss="alert" type="button">×</button>
                                {% if flashMessage.title is defined %}
                                <strong>{{ flashMessage.title }}</strong>
                                {{ flashMessage.message }}
                                {% endif %}
                            </div>
                        {% endfor %}

                    {% endblock flashbag %}

                    {% block body %}{% endblock %}
                    {% block javascripts %}{% endblock %}
                </div>
            </div> <!-- /container -->
        </div>
        
        <div class="footer">
            <div class="container">
                Fansub-Resistance
            </div>
        </div>

    </body>
</html>
